finding the angle of rotation